import httpInstance from "@/utils/http";

export function addAuthorApi(author) {
    return httpInstance({
        url: "/author/add",
        method: "put",
        data: author
    })
}


// 获取完整作者的信息
export function getById(id) {
    return httpInstance({
        url: "/author/getById/" + id,
        method: "get",
    })
}


export function getPagedAuthorsApi(page, size, flag, key) {
    return httpInstance({
        url: "/author/get/" + page + '/' + size + '?flag=' + flag + '&key=' + key,
        method: "get",
    })
}


export function updateAuthor(author) {
    return httpInstance({
        url: "/author/update",
        method: "post",
        data: author
    })
}


export function addDocAuthorApi(id1, id2) {
    return httpInstance({
        url: "/document/author/add/" + id1 + '/' + id2,
        method: "put",
    })
}

export function delDocAuthorApi(id1, id2) {
    return httpInstance({
        url: "/document/author/delete/" + id1 + '/' + id2,
        method: "delete",
    })
}